import { EggAppConfig, PowerPartial } from 'egg';
import * as path from 'path';

export default () => {
  const config: PowerPartial<EggAppConfig> = {};
  config.logger = {
    level: 'INFO',
    dir: path.join(__dirname, '../logs/prod/app'), // 保存路径为工程路径下`logs/prod/app`
  };
  config.security = {
    csrf: false,
    domainWhiteList: [ 'http://106.54.46.120:8000' ],
  };
  config.cors = {
    origin: 'http://106.54.46.120:8000',
    credentials: true,
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
  };
  return config;
};
